package player.mplayer;

import java.util.ArrayList;
import java.util.HashMap;

import player.PS;

public class PlayList {
	String name;
	String displayName;
	
	ArrayList<MediaInfo> mediaList;
	HashMap<String, MediaInfo> mediaTable;
	
	PS playerShell;
	PlayList(PS playerShell,String name){
		this.playerShell=playerShell;
		this.name=name;
		displayName=name;
		
		mediaList=new ArrayList<MediaInfo>();
		mediaTable=new HashMap<String, MediaInfo>();
	}
	
	PlayList(String name,String displayName){
		this.name=name;
		this.displayName=displayName;
	}
	
	public void addMedia(MediaInfo media){
		mediaList.add(media);
		mediaTable.put(media.mediaPath, media);
	}
	
	public void playMedia(MediaInfo media){
		MPlayerControl.playMedia(null,media);
	}
	
	public void addAndPlayMedia(MediaInfo media){
		
	}
	
	public void addAndPlayMedia(String mediaPath){
		MediaInfo media=new MediaInfo();
		media.mediaPath=mediaPath;
		addMedia(media);
		playMedia(media);
	}
	
	boolean containsMedia(String mediaPath){
		return mediaTable.containsKey(mediaPath);
	}
	
	

}
